<template>
  <view>
    <view style="width: 100vw;height: 100vh;" v-if="showMap">
      <map style="width: 100vw;height: 100vh;"
        :latitude="covers.latitude"
        :longitude="covers.longitude"
        :markers="[covers]">
      </map>
    </view>
  </view>
</template>

<script>
</script>
<script>
export default {
	data() {
		return {
      showMap: false,
			covers: {
				latitude: undefined,
				longitude: undefined,
				iconPath: 'https://taxi.raxan.xyz/wechat/static/images/location.png',
        id: 1,
        detailText: "",
        width: 50,
        height: 50,
        callout: {
          content: '',
          borderRadius: 5,
          display: 'ALWAYS',
          padding: 7,
          bgColor: "#FFFFFF"
        }
			}
		}
	},
  onLoad(option) {
    console.log(option)
    const params =  JSON.parse(option.param);
    const { latitude, longitude, poiaddress } = params;
    this.covers = {
      ...this.covers,
      latitude,
      longitude,
      callout: {
        ...this.covers.callout,
        content: poiaddress
      }
    }
    this.showMap = true;
    console.log(this)
  }
}
</script>